package com.coin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.coin.domain.UserAuthAuditRecord;
import com.coin.service.UserAuthAuditRecordService;
import com.coin.mapper.UserAuthAuditRecordMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 李力
 * @description 针对表【user_auth_audit_record(实名认证审核信息)】的数据库操作Service实现
 * @createDate 2025-06-07 10:16:53
 */
@Service
public class UserAuthAuditRecordServiceImpl extends ServiceImpl<UserAuthAuditRecordMapper, UserAuthAuditRecord>
        implements UserAuthAuditRecordService {


    @Override
    public List<UserAuthAuditRecord> getUserAuthAuditRecordList(Long id) {
        LambdaQueryWrapper<UserAuthAuditRecord> wrapper = new LambdaQueryWrapper<>();
        wrapper = wrapper.eq(id != null, UserAuthAuditRecord::getUserId, id)
                .orderByDesc(UserAuthAuditRecord::getCreated)
                .last("limit 5");
        return list(wrapper);
    }
}




